package com.xmy.cultivate.service;

import com.xmy.cultivate.entity.BackData;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 需要回滚的sql 服务类
 * </p>
 *
 * @author min
 * @since 2022-11-28
 */
public interface IBackDataService extends IService<BackData> {

    public abstract Object selectSql(String sql);

    public abstract boolean insertSql(String sql);

    public abstract boolean updateSql(String sql);

    public abstract boolean deleteSql(String sql);

    /**
     *
     * @param sourceId 回滚的资源id
     * @param type 回滚类型:默认为1
     * @param backType 回滚类型:0删除作废都回滚,1删除回滚，2作废回滚
     * @return
     */
    @Transactional
    public abstract boolean executeBackData(Long sourceId,Integer type,Integer backType);
}
